﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:globalization="clr-namespace:System.Globalization;assembly=mscorlib"
                    xmlns:converter="clr-namespace:SoftTeach.Resources.Converter"
                    xmlns:controls="clr-namespace:SoftTeach.Resources.Controls">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="..\Controls\NumericUpDown.xaml"/>
    <ResourceDictionary Source="..\Controls\HausaufgabeButton.xaml"/>
    <ResourceDictionary Source="TextStyles.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <Style x:Key="DisplayStyle">
    <Style.Triggers>
      <DataTrigger Binding="{Binding Path=IsDummy}" Value="True">
        <Setter Property="UIElement.Visibility" Value="Hidden"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>

  <!--MouseEnter="SurroundBorderMouseEnter" 
          MouseLeave="SurroundBorderMouseLeave"
          MouseLeftButtonDown="SurroundBorderMouseLeftButtonDown"-->
  <DataTemplate x:Key="TerminplanEintragDetail">
    <Border x:Name="SurroundBorder" Background="Transparent" Padding="0">
      <Border Background="{Binding Path=TerminplaneintragBackground}" CornerRadius="3">
        <Border.Triggers>
          <EventTrigger RoutedEvent="UIElement.MouseEnter">
            <BeginStoryboard>
              <Storyboard>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                             Storyboard.TargetName="EditButtons" Storyboard.TargetProperty="(UIElement.Visibility)">
                  <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                      <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                  </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames>
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
          <EventTrigger RoutedEvent="UIElement.MouseLeave">
            <BeginStoryboard>
              <Storyboard>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                             Storyboard.TargetName="EditButtons" Storyboard.TargetProperty="(UIElement.Visibility)">
                  <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                      <Visibility>Hidden</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                  </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames>
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </Border.Triggers>
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="20"/>
            <RowDefinition Height="*" MinHeight="20"/>
          </Grid.RowDefinitions>
          <Label Grid.Row="0" Grid.Column="0" Padding="5,0,5,0" VerticalAlignment="Center" 
               Content="{Binding Path=TerminplaneintragKlasse}"/>
          <Border Grid.Row="0" Grid.Column="0" Style="{StaticResource DisplayStyle}" HorizontalAlignment="Right">
            <StackPanel Orientation="Horizontal">
              <StackPanel Orientation="Horizontal" Visibility="Hidden" HorizontalAlignment="Right" x:Name="EditButtons">
                <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=EditTerminplaneintragCommand}">
                  <Image Source="/SoftTeach;component/Images/Edit16.png"/>
                </Button>
                <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=RemoveTerminplaneintragCommand}">
                  <Image Source="/SoftTeach;component/Images/Remove16.png"/>
                </Button>
                <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddNotenCommand}">
                  <Image Source="/SoftTeach;component/Images/Note16.png"/>
                </Button>
              </StackPanel>
              <Button Command="{Binding Path=ProofTerminplaneintragCommand}" 
                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
                <Image Source="{Binding Path=ProofImage}"/>
              </Button>
            </StackPanel>
          </Border>
          <Label Grid.Row="1" Padding="5,0,5,5" 
               VerticalAlignment="Bottom"  
               HorizontalAlignment="Right"
               Content="{Binding Path=TerminplaneintragOrt}"/>
          <TextBlock Grid.Row="1" Padding="5,0,5,0" VerticalAlignment="Top"  
               Text="{Binding Path=TerminplaneintragThema}" TextWrapping="Wrap"/>
        </Grid>
      </Border>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="SequenzDragAdorner">
    <Border Background="Silver" BorderBrush="Gray" BorderThickness="1" CornerRadius="2" Margin="1">
      <Grid Width="{Binding Path=SequenzBreite}" Background="{StaticResource SequenzBackgroundBrush}" Margin="3" Height="40">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=SequenzThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=SequenzStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="ReiheDragAdorner">
    <Border Background="Silver" BorderBrush="Gray" BorderThickness="1" CornerRadius="2" Margin="1">
      <Grid Width="{Binding Path=ReiheBreite}" Background="{StaticResource ReiheBackgroundBrush}" Margin="3" Height="40">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=ReiheThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=ReiheStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="PhaseDragAdorner">
    <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="2" Margin="1">
      <Grid Width="Auto" Background="{StaticResource PhaseBackgroundBrush}" Margin="2" Height="20">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=PhaseKurzinhalt}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=PhaseZeitbedarf}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="StundeDragAdorner">
    <Border Background="Silver" BorderBrush="Gray" BorderThickness="1" CornerRadius="2" Margin="1">
      <Grid Width="{Binding Path=StundeBreite}" Background="{StaticResource StundeBackgroundBrush}" Margin="3" Height="40">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=StundeStundenentwurfTitel}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=StundeStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="StundenGroupView">
    <Border CornerRadius="5">
      <Grid Width="{Binding Path=StundeDetailBreite}" Background="{StaticResource StundeBackgroundBrush}" Margin="3" Height="40">
        <Grid.InputBindings>
          <!--<MouseBinding MouseAction="RightClick" Command="{Binding Path=EditSequenzCommand}"/>-->
        </Grid.InputBindings>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=StundeStundenentwurfTitel}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=StundeStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="SequenzenGroupView">
    <Border CornerRadius="5">
      <Grid Width="{Binding Path=SequenzDetailBreite}" Background="{StaticResource SequenzBackgroundBrush}" Margin="3" Height="40">
        <Grid.InputBindings>
          <MouseBinding MouseAction="RightClick" Command="{Binding Path=EditSequenzCommand}"/>
        </Grid.InputBindings>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=SequenzThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=SequenzStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="SequenzenView">
    <Grid Width="{Binding Path=SequenzBreite}" Background="{StaticResource SequenzBackgroundBrush}" Margin="3" Height="40">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
      </Grid.RowDefinitions>
      <TextBlock Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"
                 Text="{Binding Path=SequenzThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
      <TextBlock Grid.Column="1" Grid.Row="1"
                 Text="{Binding Path=SequenzStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      <Label Grid.Column="1" Grid.Row="0" Content="{Binding Path=SequenzModulAbkürzung}" HorizontalAlignment="Right"
                 FontSize="11" Margin="0,0,1,1" Padding="3"/>
    </Grid>
  </DataTemplate>

  <Style x:Key="MonateGroupHeaderStyle" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}">
          <HeaderedContentControl Margin="0">
            <HeaderedContentControl.Header>
              <TextBlock Text="{Binding Path=Name}" Margin="0" FontSize="8"/>
            </HeaderedContentControl.Header>
            <ItemsPresenter Margin="0"/>
          </HeaderedContentControl>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="GroupHeaderStyleBoth" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}" >
          <ItemsPresenter Margin="0"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="JahrtypenHeaderStyle" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}" >
          <Border BorderThickness="3" BorderBrush="Transparent">
            <HeaderedContentControl Header="{Binding Path=Name}" HeaderTemplate="{StaticResource JahrtypHeaderControlHeader}">
              <ItemsPresenter Margin="0"/>
            </HeaderedContentControl>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}">
          <Expander x:Name="exp" IsExpanded="True" Margin="5" >
            <Expander.Header>
              <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
            </Expander.Header>
            <ItemsPresenter />
          </Expander>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <converter:InverseBooleanToVisibilityConverter x:Key="BoolVisibleConverterInverse2" />

  <DataTemplate x:Key="TagespläneView">
    <Grid Width="{Binding Path=TagesplanBreite}" Background="{Binding Path=TagesplanKalenderfarbe}" Margin="0" Height="40">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Rectangle Fill="Gray" Grid.Column="0" Visibility="{Binding Path=KeineLerngruppentermine, Converter={StaticResource BoolVisibleConverterInverse2}}"/>
      <TextBlock Grid.Column="1" 
                 Text="{Binding Path=TagesplanBeschreibung}" 
                 FontSize="8"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="3"/>
    </Grid>
  </DataTemplate>

  <DataTemplate x:Key="SchulwochenView">
    <Border CornerRadius="5" BorderBrush="Gray" BorderThickness="0">
      <Grid Width="{Binding Path=SchulwocheBreite}" Margin="0" Height="30">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <UniformGrid Grid.Column="0" Columns="5">
          <Rectangle Fill="{Binding Path=MondayBrush}"/>
          <Rectangle Fill="{Binding Path=TuesdayBrush}"/>
          <Rectangle Fill="{Binding Path=WednesdayBrush}"/>
          <Rectangle Fill="{Binding Path=ThursdayBrush}"/>
          <Rectangle Fill="{Binding Path=FridayBrush}"/>
        </UniformGrid>
        <TextBlock Grid.Column="0" 
                 Text="{Binding Path=SchulwocheBeschreibung}" 
                 FontSize="8"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="ReihenNarrowView">
    <Grid Width="{Binding Path=ReiheBreite}" Name="BaseGrid"  Background="{StaticResource ReiheBackgroundBrush}" Margin="0">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="20"/>
        <RowDefinition Height="50"/>
      </Grid.RowDefinitions>
      <Rectangle Fill="Gray" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"/>
      <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Visibility="Visible" 
                  HorizontalAlignment="Left" x:Name="EditButtons" Margin="1,0,1,0">
        <Button Width="13" Height="13" Command="{Binding Path=LengthenReiheCommand}" 
                Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
                VerticalAlignment="Bottom">
          <Image Source="/SoftTeach;component/Images/Plus7.png"/>
        </Button>
        <Button  Width="12" Height="12" Command="{Binding Path=ShortenReiheCommand}" 
                 Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
                 VerticalAlignment="Bottom">
          <Image Source="/SoftTeach;component/Images/Minus7.png"/>
        </Button>
      </StackPanel>
      <TextBlock Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"
                 Text="{Binding Path=ReiheThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="3"/>
      <TextBlock Grid.Column="2" Grid.Row="1"
                 Text="{Binding Path=ReiheBausteine}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="3" TextTrimming="CharacterEllipsis" />
      <TextBlock Grid.Column="3" Grid.Row="1"
                 Text="{Binding Path=ReiheStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0" 
                 Padding="3"/>
    </Grid>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=ReiheIsDummy}">
        <DataTrigger.Value>
          <system:Boolean>true</system:Boolean>
        </DataTrigger.Value>
        <Setter TargetName="BaseGrid" Property="Background" Value="LightGreen"/>
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

  <DataTemplate x:Key="ReihenGroupView">
    <Border CornerRadius="5" Margin="3" Background="{StaticResource ReiheBackgroundBrush}">
      <Grid Margin="1" Height="40" Width="200">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="0"
                 Text="{Binding Path=ReiheThema}" 
                 FontSize="11"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="1,0,0,1" 
                 Padding="3"/>
        <TextBlock Grid.Column="1"
                 Text="{Binding Path=ReiheStundenbedarfString}" 
                 FontSize="11" HorizontalAlignment="Right" Margin="0,0,1,1" 
                 Padding="3"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="SequenzenNarrowView">
    <Grid Width="{Binding Path=SequenzBreite}" Background="{StaticResource SequenzBackgroundBrush}" Margin="0" Height="30">
      <Grid.InputBindings>
        <MouseBinding MouseAction="RightClick" Command="{Binding Path=EditSequenzCommand}"/>
      </Grid.InputBindings>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="15"/>
        <RowDefinition Height="15"/>
      </Grid.RowDefinitions>
      <Rectangle Fill="Gray" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"/>
      <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Visibility="Visible" 
                  HorizontalAlignment="Left" x:Name="EditButtons" Margin="2,0,0,0">
        <Button Width="12" Height="12" Command="{Binding Path=LengthenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Plus7.png"/>
        </Button>
        <Button  Width="12" Height="12" Command="{Binding Path=ShortenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Minus7.png"/>
        </Button>
      </StackPanel>
      <TextBlock Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"
                 Text="{Binding Path=SequenzKurzbezeichnung}" 
                 FontSize="10"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="1" TextTrimming="CharacterEllipsis">
        <TextBlock.ToolTip>
          <Label Content="{Binding Path=SequenzKurzbezeichnung}"/>
        </TextBlock.ToolTip>
      </TextBlock>
      <TextBlock Grid.Column="2" Grid.Row="1"
                 Text="{Binding Path=SequenzStundenbedarfString}" 
                 FontSize="10" HorizontalAlignment="Right" Margin="0" 
                 Padding="1"/>
    </Grid>

  </DataTemplate>

  <DataTemplate x:Key="SequenzenTagesplanView">
    <Grid Width="{Binding Path=SequenzStundenbreite}" Background="{StaticResource SequenzBackgroundBrush}" Margin="0" Height="30">
      <Grid.InputBindings>
        <MouseBinding MouseAction="RightClick" Command="{Binding Path=EditSequenzCommand}"/>
      </Grid.InputBindings>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="15"/>
        <RowDefinition Height="15"/>
      </Grid.RowDefinitions>
      <Rectangle Fill="Gray" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"/>
      <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Visibility="Visible" 
                  HorizontalAlignment="Left" x:Name="EditButtons" Margin="2,0,0,0">
        <Button Width="12" Height="12" Command="{Binding Path=LengthenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Plus7.png"/>
        </Button>
        <Button  Width="12" Height="12" Command="{Binding Path=ShortenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Minus7.png"/>
        </Button>
      </StackPanel>
      <TextBlock Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"
                 Text="{Binding Path=SequenzKurzbezeichnung}" 
                 FontSize="10"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="1" TextTrimming="CharacterEllipsis">
        <TextBlock.ToolTip>
          <Label Content="{Binding Path=SequenzKurzbezeichnung}"/>
        </TextBlock.ToolTip>
      </TextBlock>
      <TextBlock Grid.Column="2" Grid.Row="1"
                 Text="{Binding Path=SequenzStundenbedarfString}" 
                 FontSize="10" HorizontalAlignment="Right" Margin="0" 
                 Padding="1"/>
    </Grid>

  </DataTemplate>

  <DataTemplate x:Key="StundenTagesplanView">
    <Grid Width="{Binding Path=StundeBreite}" Background="{StaticResource StundeBackgroundBrush}" Margin="0" Height="30">
      <Grid.InputBindings>
        <!--<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditSequenzCommand}"/>-->
      </Grid.InputBindings>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="15"/>
        <RowDefinition Height="15"/>
      </Grid.RowDefinitions>
      <Rectangle Fill="Gray" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"/>
      <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Visibility="Visible" 
                  HorizontalAlignment="Left" x:Name="EditButtons" Margin="2,0,0,0">
        <!--<Button Width="12" Height="12" Command="{Binding Path=LengthenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Plus7.png"/>
        </Button>
        <Button  Width="12" Height="12" Command="{Binding Path=ShortenSequenzCommand}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
          <Image Source="/SoftTeach;component/Images/Minus7.png"/>
        </Button>-->
      </StackPanel>
      <TextBlock Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"
                 Text="{Binding Path=StundeStundenentwurfTitel}" 
                 FontSize="10"
                 HorizontalAlignment="Left" 
                 TextWrapping="WrapWithOverflow"              
                 Margin="0" 
                 Padding="1" TextTrimming="CharacterEllipsis">
        <TextBlock.ToolTip>
          <Label Content="{Binding Path=StundeStundenentwurfTitel}"/>
        </TextBlock.ToolTip>
      </TextBlock>
      <TextBlock Grid.Column="2" Grid.Row="1"
                 Text="{Binding Path=StundeStundenbedarfString}" 
                 FontSize="10" HorizontalAlignment="Right" Margin="0" 
                 Padding="1"/>
    </Grid>

  </DataTemplate>

  <Style x:Key="NotenGroupHeaderStyle" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}">
          <Expander IsExpanded="True" Margin="0">
            <Expander.Header>
              <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" Padding="0"/>
            </Expander.Header>
            <ItemsPresenter>
            </ItemsPresenter>
          </Expander>
          <!--<HeaderedContentControl Margin="5" Header="{Binding Path=Name}">
            <ItemsPresenter />
          </HeaderedContentControl>-->
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="NotenMonthGroupHeaderStyle" TargetType="{x:Type GroupItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type GroupItem}">
          <HeaderedContentControl Padding="0">
            <HeaderedContentControl.Header>
              <Label Content="{Binding Path=Name}" Margin="0" Padding="3,0,0,0"/>
            </HeaderedContentControl.Header>
            <ItemsPresenter />
          </HeaderedContentControl>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="NotenBorderStyle" TargetType="{x:Type Border}">
    <Setter Property="Margin" Value="2"/>
    <Setter Property="Padding" Value="2"/>
    <!--<Setter Property="CornerRadius" Value="5"/>-->
  </Style>

  <DataTemplate x:Key="MündlicheNotenGroupView">
    <Border Style="{StaticResource NotenBorderStyle}" Background="{StaticResource NotenBrush}">
      <Border.InputBindings>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditNoteCommand}"/>
      </Border.InputBindings>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="24"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0"  
               Style="{StaticResource NotenStyle}" Content="{Binding Path=ZensurString}">
          <Label.ToolTip>
            <TextBlock Grid.Column="1"
                 Text="{Binding Path=NoteDatum, StringFormat={}{0:dd. MMMM yyyy}}"          
                 VerticalAlignment="Bottom"
                 Margin="3"/>
          </Label.ToolTip>
        </Label>
        <Label Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" Padding="0"
               FontSize="8" Content="{Binding Path=NoteGewichtung}"/>
        <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Padding="0"
               Content="{Binding Path=NoteBezeichnung}"
               FontSize="8"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="NotenDetailView">
    <Border Style="{StaticResource NotenBorderStyle}" Background="{StaticResource NotenBrush}">
      <Border.InputBindings>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditNoteCommand}"/>
      </Border.InputBindings>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="25"/>
          <ColumnDefinition Width="80"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Style="{StaticResource NotenStyle}" Content="{Binding Path=ZensurString}"/>
        <Label Grid.Row="0" Grid.Column="1" VerticalAlignment="Top" Padding="0" FontSize="8" Content="{Binding Path=NoteGewichtung}"/>
        <TextBlock Grid.Row="1"  Grid.Column="1"  Text="{Binding Path=NoteDatum, StringFormat={}{0:ddd dd.MM.yy}}" FontSize="8" Padding="0"/>
        <Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Padding="3,0" Content="{Binding Path=NoteBezeichnung}" FontSize="8"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="NotenSafeDetailView">
    <Border Style="{StaticResource NotenBorderStyle}" Background="{StaticResource NotenBrush}">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="25"/>
          <ColumnDefinition Width="80"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Style="{StaticResource NotenStyle}" Content="{Binding Path=ZensurString}"/>
        <TextBlock Grid.Row="0"  Grid.Column="1"  Text="{Binding Path=NoteDatum, StringFormat={}{0:ddd dd.MM.yy}}" FontSize="8" Padding="0"/>
        <Label Grid.Row="1" Grid.Column="1" Padding="0" Content="{Binding Path=NoteBezeichnung}" FontSize="8"/>
      </Grid>
    </Border>
  </DataTemplate>
  
  <DataTemplate x:Key="NotenstandDetailView">
    <Border Style="{StaticResource NotenBorderStyle}" Background="{StaticResource StandBrush}">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="25"/>
          <ColumnDefinition Width="80"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Style="{StaticResource NotenStyle}" Content="{Binding Path=ZensurString}"/>
        <TextBlock Grid.Row="0"  Grid.Column="1"  Text="{Binding Path=NoteDatum, StringFormat={}{0:ddd dd.MM.yy}}" FontSize="8" Padding="0"/>
        <Label Grid.Row="1" Grid.Column="1" Padding="0" Content="{Binding Path=NoteBezeichnung}" FontSize="8"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="NotenlisteneintragView">
    <Border Style="{StaticResource NotenBorderStyle}" Background="{StaticResource NotenBrush}">
      <!--<Border.InputBindings>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditNoteCommand}"/>
      </Border.InputBindings>-->
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Content="{Binding Path=NotenTermintyp}"/>
        <Label Grid.Row="1" Content="{Binding Path=TerminString}"/>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="WeitereMündlicheNotenListView">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="150"/>
        <ColumnDefinition Width="30"/>
      </Grid.ColumnDefinitions>
      <Label Grid.Column="0" Content="{Binding Path=NoteBezeichnung}"           
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"/>
      <Label Grid.Column="1" Content="{Binding Path=ZensurString}" 
                 HorizontalAlignment="Left"
                 Style="{StaticResource NotenStyle}"
                 VerticalAlignment="Center"/>
    </Grid>
  </DataTemplate>

  <DataTemplate x:Key="KlassenlisteHausaufgabenView">
    <Button Style="{StaticResource HausaufgabeButton}" Name="HAButton"
      Command="{Binding Path=AddHausaufgabeCommand}">
      <!--Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"-->
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition/>
          <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Margin="0" Padding="0" Content="{Binding Path=SchülereintragPerson.PersonVorname}"/>
        <Label Grid.Row="1" Grid.Column="0" Margin="0" Padding="0" Content="{Binding Path=SchülereintragPerson.PersonNachname}"/>
        <Label Grid.Row="1" Grid.Column="1" Margin="0" Padding="5,0,0,0" Content="{Binding Path=NichtGemachteHausaufgabenAnzahl}"/>
      </Grid>
    </Button>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=CurrentHausaufgabe}">
        <DataTrigger.Value>
          <x:Null></x:Null>
        </DataTrigger.Value>
        <Setter TargetName="HAButton" Property="Background" Value="{x:Null}"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=CurrentHausaufgabe.HausaufgabeIstNachgereicht}">
        <DataTrigger.Value>
          <system:Boolean>True</system:Boolean>
        </DataTrigger.Value>
        <Setter TargetName="HAButton" Property="Background" Value="{StaticResource HausaufgabeNachgereichtBrush}"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=CurrentHausaufgabe.HausaufgabeIstNachgereicht}">
        <DataTrigger.Value>
          <system:Boolean>False</system:Boolean>
        </DataTrigger.Value>
        <Setter TargetName="HAButton" Property="Background" Value="{StaticResource HausaufgabeNichtGemachtBrush}"/>
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

  <DataTemplate x:Key="HausaufgabenGroupView">
    <Border Style="{StaticResource NotenBorderStyle}"  Name="HAButton" 
            Background="{Binding Path=HausaufgabeIstNachgereichtFarbe}">
      <Border.InputBindings>
        <MouseBinding MouseAction="RightClick" Command="{Binding Path=ChangeHausaufgabeNichtGemachtCommand}"/>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditHausaufgabeCommand}"/>
      </Border.InputBindings>
      <Grid Margin="3">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Padding="0" Content="{Binding Path=HausaufgabeBezeichnung}"/>
        <Label Grid.Row="1" HorizontalAlignment="Left" Padding="0"
               FontSize="8" Content="{Binding Path=HausaufgabeDatumString}"/>
      </Grid>
    </Border>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=HausaufgabeIstNachgereicht}">
        <DataTrigger.Value>
          <system:Boolean>True</system:Boolean>
        </DataTrigger.Value>
        <Setter TargetName="HAButton" Property="Background" Value="{StaticResource HausaufgabeNachgereichtBrush}"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=HausaufgabeIstNachgereicht}">
        <DataTrigger.Value>
          <system:Boolean>False</system:Boolean>
        </DataTrigger.Value>
        <Setter TargetName="HAButton" Property="Background" Value="{StaticResource HausaufgabeNichtGemachtBrush}"/>
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

  <DataTemplate x:Key="NotentendenzenGroupView">
    <Border Style="{StaticResource NotenBorderStyle}"  Background="{StaticResource NotentendenzBrush}">
      <Border.InputBindings>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditNotentendenzCommand}"/>
      </Border.InputBindings>
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
          <!--<ColumnDefinition Width="Auto"/>-->
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0" Padding="0"
               Content="{Binding Path=NotentendenzBezeichnung}"/>
        <Label Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" FontSize="8" Padding="0"
               Content="{Binding Path=NotentendenzTendenztyp.TendenztypBezeichnung}"/>
        <Label Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Padding="0"
               FontSize="8" Content="{Binding Path=NotentendenzDatumString}"/>
        <Label Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="3,0,0,0"
             FontSize="14" FontFamily="Arial" Content="{Binding Path=NotentendenzTendenz.TendenzBezeichnung}"/>
        <!--<Border Grid.Row="0" Grid.Column="2" Grid.RowSpan="3">
          <StackPanel Visibility="Hidden" HorizontalAlignment="Right" x:Name="EditButtons">
            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=EditNotentendenzCommand}">
              <Image Source="/SoftTeach;component/Images/Edit16.png"/>
            </Button>
            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=RemoveNotentendenzCommand}">
              <Image Source="/SoftTeach;component/Images/Remove16.png"/>
            </Button>
          </StackPanel>-->
      </Grid>
    </Border>
  </DataTemplate>

  <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" x:Key="NotenClickButton">
    <Setter Property="Margin" Value="1"/>
    <Setter Property="Padding" Value="1"/>
    <Style.Triggers>
      <!-- Changes the button's color when clicked. 
               Notice that the animation can't target the
               SolidColorBrush used to paint the button's background
               directly. The brush must be accessed through the button's
               Background property. -->
      <EventTrigger RoutedEvent="Button.Click">
        <EventTrigger.Actions>
          <BeginStoryboard>
            <Storyboard>
              <ColorAnimation 
                    Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
                    To="LightGreen" Duration="0:0:0.1" AutoReverse="False" />
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger.Actions>
      </EventTrigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" x:Key="ZeugnisnotenAnpassungsButton">
    <Setter Property="FontSize" Value="24"/>
    <!--<Setter Property="Width" Value="20"/>
    <Setter Property="Height" Value="20"/>-->
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
  </Style>

  <DataTemplate x:Key="ZeugnisNotenView">
    <Grid Opacity="0.7" Background="White">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="50"/>
        <ColumnDefinition Width="150"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Image Grid.Column="0" Height="50" Source="{Binding Path=SchülereintragPerson.PersonBild}" Margin="0"/>
      <Grid Grid.Column="1">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="70"/>
          <ColumnDefinition Width="80"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition/>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
          <Label Style="{StaticResource ZeugnisnotenHeader}" Content="{Binding Path=SchülereintragPerson.PersonVorname}"/>
          <Label Style="{StaticResource ZeugnisnotenHeader}" Content="{Binding Path=SchülereintragPerson.PersonNachname}"/>
        </StackPanel>
        <Label Grid.Row="1" Grid.Column="0">HA</Label>
        <Image Grid.Row="1" Grid.Column="1" Source="{Binding Path=HausaufgabenTendenzImage}" Height="16"/>
        <Label Grid.Row="2" Grid.Column="0">Tendenzen</Label>
        <Image Grid.Row="2" Grid.Column="1" Source="{Binding Path=TendenzenTendenzImage}" Height="16"/>
      </Grid>
      <Grid Grid.Column="2">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="70"/>
          <ColumnDefinition Width="20"/>
          <ColumnDefinition Width="55"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition/>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Style="{StaticResource ZeugnisnotenHeader}">Mündlich</Label>
        <Label Grid.Row="0" Grid.Column="1" Style="{StaticResource ZeugnisnotenHeader}" Content="{Binding Path=MündlicheGesamtNote}"/>
        <controls:NumericUpDown Grid.Row="0" Grid.Column="2" Grid.RowSpan="4" VerticalAlignment="Top" Style="{StaticResource NumericUpDownRoundStyle}"
                                Value="{Binding Path=MündlicheAnpassung, Mode=TwoWay}"
                                Minimum="-10"
                                Change="1"
                                Maximum="10"/>
        <!--<StackPanel>
            <Button Command="{Binding Path=Qualität1Command}" Style="{StaticResource ZeugnisnotenAnpassungsButton}" Content="+"/>
            <Button Command="{Binding Path=Qualität2Command}" Style="{StaticResource ZeugnisnotenAnpassungsButton}" Content="-"/>
          </StackPanel>-->
        <Label Grid.Row="1" Grid.Column="0" Padding="1">Qualität</Label>
        <Label Grid.Row="1" Grid.Column="1" Padding="1" Content="{Binding Path=MündlicheQualitätNote}"/>
        <Label Grid.Row="2" Grid.Column="0" Padding="1">Quantität</Label>
        <Label Grid.Row="2" Grid.Column="1" Padding="1" Content="{Binding Path=MündlicheQuantitätNote}"/>
        <Label Grid.Row="3" Grid.Column="0" Padding="1">Weitere</Label>
        <Label Grid.Row="3" Grid.Column="1" Padding="1" Content="{Binding Path=MündlicheWeitereNotenGesamtnote}"/>
      </Grid>
      <Grid Grid.Column="3" >
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="70"/>
          <ColumnDefinition Width="20"/>
          <ColumnDefinition Width="55"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition/>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Style="{StaticResource ZeugnisnotenHeader}" >Schriftlich</Label>
        <Label Grid.Row="0" Grid.Column="1" Style="{StaticResource ZeugnisnotenHeader}" Content="{Binding Path=SchriftlicheGesamtNote}"/>
        <controls:NumericUpDown Grid.Row="0" Grid.Column="2" Grid.RowSpan="4" VerticalAlignment="Top" Style="{StaticResource NumericUpDownRoundStyle}"
                                Value="{Binding Path=SchriftlicheAnpassung, Mode=TwoWay}"
                                Minimum="-10"
                                Change="1"
                                Maximum="10"/>
        <Label Grid.Row="1" Grid.Column="0" Padding="1">Arbeiten</Label>
        <Label Grid.Row="1" Grid.Column="1" Padding="1" Content="{Binding Path=SchriftlichKlausurenGesamtnote}"/>
        <Label Grid.Row="2" Grid.Column="0" Padding="1">Weitere</Label>
        <Label Grid.Row="2" Grid.Column="1" Padding="1" Content="{Binding Path=SchriftlichWeitereNotenGesamtnote}"/>
      </Grid>
      <Grid Grid.Column="4" >
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="50"/>
          <ColumnDefinition Width="20"/>
          <ColumnDefinition Width="55"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Column="0" Style="{StaticResource ZeugnisnotenHeader}">Gesamt</Label>
        <Label Grid.Column="1" Style="{StaticResource ZeugnisnotenHeader}" Content="{Binding Path=Gesamtnote}"/>
        <controls:NumericUpDown Grid.Column="2"  VerticalAlignment="Top" Style="{StaticResource NumericUpDownRoundStyle}"
                                Value="{Binding Path=GesamtAnpassung, Mode=TwoWay}"
                                Minimum="-10"
                                 Change="1"
                                Maximum="10"/>

        <!--<StackPanel Orientation="Horizontal">
          <Button Command="{Binding Path=Qualität1Command}" Style="{StaticResource ZeugnisnotenAnpassungsButton}" Content="+"/>
          <Button Command="{Binding Path=Qualität2Command}" Style="{StaticResource ZeugnisnotenAnpassungsButton}" Content="-"/>
        </StackPanel>-->
      </Grid>
    </Grid>
  </DataTemplate>

  <DataTemplate x:Key="KlassenlisteNotenView">
    <DataTemplate.Resources>
      <SolidColorBrush x:Key="AnimatedBrush" Color="Transparent" />
    </DataTemplate.Resources>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="40"/>
        <ColumnDefinition Width="200"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Height="50" Source="{Binding Path=SchülereintragPerson.PersonBild}" Margin="0"/>
      <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
        <Label Content="{Binding Path=SchülereintragPerson.PersonVorname}"/>
        <Label Content="{Binding Path=SchülereintragPerson.PersonNachname}"/>
      </StackPanel>
      <Label Grid.Row="0" Grid.Column="2">Qualität</Label>
      <UniformGrid Grid.Row="0" Grid.Column="3" Margin="0" Rows="1" Columns="6">
        <Button Command="{Binding Path=Qualität1Command}" Style="{StaticResource NotenClickButton}" Content="1"/>
        <Button Command="{Binding Path=Qualität2Command}" Style="{StaticResource NotenClickButton}" Content="2"/>
        <Button Command="{Binding Path=Qualität3Command}" Style="{StaticResource NotenClickButton}" Content="3"/>
        <Button Command="{Binding Path=Qualität4Command}" Style="{StaticResource NotenClickButton}" Content="4"/>
        <Button Command="{Binding Path=Qualität5Command}" Style="{StaticResource NotenClickButton}" Content="5"/>
        <Button Command="{Binding Path=Qualität6Command}" Style="{StaticResource NotenClickButton}" Content="6"/>
      </UniformGrid>
      <Label Grid.Row="1" Grid.Column="2">Quantität</Label>
      <UniformGrid Grid.Row="1" Grid.Column="3" Margin="0" Rows="1" Columns="6">
        <Button Command="{Binding Path=Quantität1Command}" Background="{StaticResource AnimatedBrush}" Style="{StaticResource NotenClickButton}" Content="1"/>
        <Button Command="{Binding Path=Quantität2Command}" Style="{StaticResource NotenClickButton}" Content="2"/>
        <Button Command="{Binding Path=Quantität3Command}" Style="{StaticResource NotenClickButton}" Content="3"/>
        <Button Command="{Binding Path=Quantität4Command}" Style="{StaticResource NotenClickButton}" Content="4"/>
        <Button Command="{Binding Path=Quantität5Command}" Style="{StaticResource NotenClickButton}" Content="5"/>
        <Button Command="{Binding Path=Quantität6Command}" Style="{StaticResource NotenClickButton}" Content="6"/>
      </UniformGrid>
    </Grid>
  </DataTemplate>

  <DataTemplate x:Key="KlassenlisteSonstigeNotenView">
    <DataTemplate.Resources>
      <SolidColorBrush x:Key="AnimatedBrush" Color="Transparent" />
    </DataTemplate.Resources>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <StackPanel Grid.Column="0" Orientation="Horizontal">
        <Label Content="{Binding Path=SchülereintragPerson.PersonVorname}"/>
        <Label Content="{Binding Path=SchülereintragPerson.PersonNachname}"/>
      </StackPanel>
      <UniformGrid Grid.Column="1" Margin="0" Rows="1" Columns="6">
        <Button Command="{Binding Path=SonstigeNote1Command}" Style="{StaticResource NotenClickButton}" Content="1"/>
        <Button Command="{Binding Path=SonstigeNote2Command}" Style="{StaticResource NotenClickButton}" Content="2"/>
        <Button Command="{Binding Path=SonstigeNote3Command}" Style="{StaticResource NotenClickButton}" Content="3"/>
        <Button Command="{Binding Path=SonstigeNote4Command}" Style="{StaticResource NotenClickButton}" Content="4"/>
        <Button Command="{Binding Path=SonstigeNote5Command}" Style="{StaticResource NotenClickButton}" Content="5"/>
        <Button Command="{Binding Path=SonstigeNote6Command}" Style="{StaticResource NotenClickButton}" Content="6"/>
      </UniformGrid>
    </Grid>
  </DataTemplate>

  <DataTemplate x:Key="SchülerlisteSingleView">
    <StackPanel Orientation="Horizontal" Margin="0">
      <Label Margin="0" Padding="1" Content="{Binding Path=SchülereintragPerson.PersonVorname}"/>
      <Label Margin="0" Padding="1" Content="{Binding Path=SchülereintragPerson.PersonNachname}"/>
    </StackPanel>
  </DataTemplate>

  <DataTemplate x:Key="SchülerlisteGruppenView">
    <Border Background="LightBlue" CornerRadius="10" Padding="2,2,2,2">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="{Binding Path=Key}" FontSize="14" Margin="6,2,6,2"/>
        <ListBox Grid.Row="1" ItemsSource="{Binding}"
                 BorderThickness="0"
                 ItemTemplate="{StaticResource SchülerlisteSingleView}"
                 ItemContainerStyle="{StaticResource UnselectableListBoxItem}">
          <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
              <StackPanel/>
            </ItemsPanelTemplate>
          </ListBox.ItemsPanel>
        </ListBox>
      </Grid>
    </Border>
  </DataTemplate>

  <DataTemplate x:Key="RaumplanListBoxView">
    <Border Margin="3" BorderThickness="1" BorderBrush="{StaticResource MetroHeaderBackground}">
      <Border.InputBindings>
        <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Path=EditRaumplanCommand}"/>
      </Border.InputBindings>
      <Grid Margin="5" Height="180" Width="200">
        <Image Source="{Binding Path=RaumplanImage}"/>
        <TextBlock Text="{Binding Path=RaumplanBezeichnung}" HorizontalAlignment="Right"/>
      </Grid>
    </Border>
  </DataTemplate>

  <Style x:Key="NoBorderListBoxItemStyle" TargetType="ListBoxItem">
    <Setter Property="Padding" Value="0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border x:Name="Border" Padding="0" SnapsToDevicePixels="true" Background="Transparent">
            <ContentPresenter />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>